<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script>


	$(function(){
	

		stockInOption();

	})


	// 执行货物入库操作
	function stockInOption(){
		$('#submit').click(function(){


			data = {
                mediaName : $('#media_name').val(),
                mediaCategory : $('#media_category').val(),
                mediaGrade : $('#media_grade').val(),
				mediaUrl : $('#media_url').val(),
			}
			$.ajax({
				"type" : 'POST',
                "url" : 'mediaManage/addMedia',
				"dataType" : 'json',
				"content" : 'application/json',
				"data" : data,
				success : function(response){
					var msg;
					var type;
					var append = '';
					if(response.result == "success"){
						type = 'success';
						msg = '媒资信息新增成功';
						inputReset();
					}else{
						type = 'error';
						msg = '媒资信息新增失败'
					}
					showMsg(type, msg, append);
				},
				error : function(xhr, textStatus, errorThrown){
					// handler error
					handleAjaxError(xhr.status);
				}
			})
		});
	}

	// 页面重置
	function inputReset(){
		$('#media_name').val('');
		$('#media_category').val('');
        $('#media_grade').val('');
		$('#media_url').val('');
	}

</script>


<div class="panel panel-default">
	<ol class="breadcrumb">
		<li>媒资信息管理</li>
	</ol>
	<div class="panel-body">
		<div class="row" style="text-align: center;">
			<div class="col-md-10 col-sm-10">
				<div class="row">
					<div class="col-md-1 col-sm-1"></div>
					<div class="col-md-10 col-sm-11">
						<form action="" class="form-inline">
							<div class="form-group">
								<label for="" class="form-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;媒资名称：</label>
								<input type="text" class="form-control" id="media_name" placeholder="请输入媒资名称">
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<div class="row" style="margin-top:40px"></div>
		<div class="row" style="text-align: center;">
			<div class="col-md-10 col-sm-10">
				<div class="row">
					<div class="col-md-1 col-sm-1"></div>
					<div class="col-md-10 col-sm-11">
						<form action="" class="form-inline">
							<div class="form-group">
								<label for="" class="form-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;媒资分类：</label>
								<input type="text" class="form-control" id="media_category" placeholder="请输入媒资分类">
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<div class="row" style="margin-top:40px"></div>
		<div class="row" style="text-align: center;">
			<div class="col-md-10 col-sm-10">
				<div class="row">
					<div class="col-md-1 col-sm-1"></div>
					<div class="col-md-10 col-sm-11">
						<form action="" class="form-inline">
							<div class="form-group">
								<label for="" class="form-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;媒资等级：</label>
<%--								<select name="" id="repository_selector" class="form-control">--%>
<%--								</select>--%>
                                <input type="text" class="form-control" id="media_grade" placeholder="请输入媒资分类">
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<div class="row" style="margin-top:40px"></div>
		<div class="row" style="text-align: center;">
			<div class="col-md-10 col-sm-10">
				<div class="row">
					<div class="col-md-1 col-sm-1"></div>
					<div class="col-md-10 col-sm-11">
						<form action="" class="form-inline" id="stockin_form">
							<div class="form-group">
								<label for="" class="control-label">媒资存储地址：</label>
								<input type="text" class="form-control" placeholder="请输入媒资存储地址" id="media_url" name="media_url">
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>


	</div>
	<div class="panel-footer">
		<div style="text-align:right">
			<button class="btn btn-success" id="submit">确认新增</button>
		</div>
	</div>
</div>

